﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

namespace AbpToDomain.EntityInfo
{
    public class Inlethouse : Entity
    {


        [Key]
        public Guid Id_Inlethouse { get; set; }
        [Comment("仓库描述")]
        public string? InlethouseName { get; set; }
        [Comment("参数")]
        public string? parameter { get; set; }
        [Comment("仓库号")]
        public string InlethouseCode { get; set; }
        [Comment("排")]
        public int Xaxis { get; set; }
        [Comment("高")]
        public int Yaxis { get; set; }
        [Comment("列")]
        public int Zaxis { get; set; }
        public DateTime CreatTime { get; set; }
        public DateTime? UpdateTime { get; set; }
        public override object[] GetKeys()
        {
            return new object[] { Id_Inlethouse };
        }
        //foreignkey
        public List<InlethouseLine>? inlethouselines { get; set; } = new List<InlethouseLine>();
        //function
        public Inlethouse AddInlethouse(string WarehouseCode, int Xaxis, int Yaxis, int Zaxis,
                                         string? InlethouseName, string? parameter)

        {
            Inlethouse Inlethouse = new Inlethouse();
            Inlethouse.InlethouseCode = WarehouseCode;
            Inlethouse.InlethouseName = InlethouseName;
            Inlethouse.parameter = parameter;
            Inlethouse.Xaxis = Xaxis;
            Inlethouse.Yaxis = Yaxis;
            Inlethouse.Zaxis = Zaxis;
            Inlethouse.CreatTime = DateTime.Now;
            return Inlethouse;
        }
    }
    public class InlethouseLine : Entity
    {
        [Key]
        public Guid Id_InlethouseLine { get; set; }
        public string InlethouseLineCode { get; set; }
        public DateTime CreatTime { get; set; }
        public int Long { get; set; }
        public int Wide { get; set; }
        public int high { get; set; }
        [Comment("输送线/缓存架")]
        public string Type { get; set; }
        [Comment("是否使能")]
        public bool IsEnable { get; set; }
        [Comment("是否占用")]
        public bool IsOccupy { get; set; }
        [Comment("排")]
        public int Xaxis { get; set; }
        [Comment("高")]
        public int Yaxis { get; set; }
        [Comment("列")]
        public int Zaxis { get; set; }
        [Comment("入口/出口")]
        public string? LineType { get; set; }
        //foreignKey
        public Inlethouse TheInlethouse { get; set; }

        public Box? Box { get; set; }
        //function
        public InlethouseLine AddInlethouseline(int Long, int Wide, int high, int Xaxis, int Yaxis, int Zaxis, Inlethouse? TheInlethouse,string Type,string?LineType)
        {
            InlethouseLine Inlethouseline = new InlethouseLine();
            Inlethouseline.Long = Long;
            Inlethouseline.TheInlethouse = TheInlethouse;
            Inlethouseline.Wide = Wide;
            Inlethouseline.high = high;
            Inlethouseline.Xaxis = Xaxis;
            Inlethouseline.Yaxis = Yaxis;
            Inlethouseline.Zaxis = Zaxis;
            Inlethouseline.IsEnable = true;
            Inlethouseline.Type = Type;
            Inlethouseline.LineType = LineType;
            Inlethouseline.CreatTime = DateTime.Now;
            return Inlethouseline;

        }
        public override object[] GetKeys()
        {
            return new object[] { Id_InlethouseLine };
        }

    }




}
